Crate genai

Source
Expand description

genai library - Any AI provider AI client library. See examples/c00-readme.rs

Modules§

  • The Adapter layer allows adapting client requests/responses to various AI Providers. Currently, it employs a static dispatch pattern with the Adapter trait and AdapterDispatcher implementation. Adapter implementations are organized by adapter type under the adapters submodule.
  • The genai chat module contains all of the constructs necessary to make genai requests with the genai::Client.
  • Resolvers are hooks that library users can set to customize aspects of the library’s default behavior. A good example for now is the AuthResolver, which provides the authentication data (e.g., api_key).
  • The GenAI web client construct that uses reqwest. Only webc::Error is exposed as the public interface.

Structs§

  • genai Client for executing AI requests to any providers. Build with:
  • The builder for the Client structure.
  • The Client configuration used in the configuration builder stage.
  • Holds the adapter kind and model name in an efficient, clonable way.
  • The model name, which is just an Arc<str> wrapper (simple and relatively efficient to clone)

Enums§

Type Aliases§

  • GenAI main Result type alias (with genai::Error)